package com.yc;


import com.yc.config.HelloLoadBalancerConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClientConfiguration;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@EnableDiscoveryClient  // 启用 Nacos 注册发现
@EnableFeignClients(basePackages = "com.yc.client") // 指定接口所在包  // 启用 Feign 客户端, 利用动态代理机制, 实现服务调用


@LoadBalancerClients(value={
        @LoadBalancerClient(name = "hello", configuration = HelloLoadBalancerConfig.class),
        @LoadBalancerClient(name = "idGenerator", configuration = com.yc.config.IdGeneratorLoadBalancerConfig.class),

},
        defaultConfiguration= LoadBalancerClientConfiguration.class)  // loadBalancer启动器starter自带的配置类
public class TestApp {
    public static void main(String[] args) {
        SpringApplication.run(TestApp.class, args);
    }
}
